home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld: Complete Mac Interactive
/
Macworld Complete Mac Interactive CD)(1994).iso
/
Software
/
More Shareware⁄Freeware
/
NIH Image 1.55 f (non fpu)
/
Macros
/
Animation
next >
Wrap
Text File
|
1993-11-02
|
2KB
|
115 lines
{This file contains additional macros that work with stacks.}
procedure CheckForStack;
begin
if nPics=0 then begin
PutMessage('This macro requires a stack.');
exit;
end;
if nSlices=0 then begin
PutMessage('This window is not a stack.');
exit;
end;
end;
macro 'Add Slice [A]'; begin CheckForStack; AddSlice end;
macro 'Delete Slice [D]'; begin CheckForStack; DeleteSlice end;
macro 'First Slice [F]'; begin CheckForStack; SelectSlice(1) end;
macro 'Last Slice [L]'; begin CheckForStack; SelectSlice(nSlices) end;
macro '(-' begin end;
macro 'Smooth';
var
i:integer;
begin
CheckForStack;
for i:= 1 to nSlices do begin
SelectSlice(i);
SetOption; Smooth;
end;
end;
macro 'Invert';
var
i:integer;
begin
CheckForStack;
for i:= 1 to nSlices do begin
SelectSlice(i);
Invert;
end;
end;
macro 'Make Surface Plot Movie…';
var
i,OldStack,NewStack:integer;
N,PlotWidth,PlotHeight:integer;
ScaleFactor:real;
OneToOne:boolean;
begin
RequiresVersion(1.50);
CheckForStack;
SaveState;
OldStack:=PicNumber;
N:=nSlices;
PlotWidth:=GetNumber('Surface Plot Width:',300);
PlotHeight:=GetNumber('Surface Plot Height:',PlotWidth);
SetNewSize(PlotWidth,PlotHeight);
MakeNewStack('Stack');
NewStack:=PicNumber;
SelectPic(OldStack);
for i:= 1 to N do begin
SelectSlice(1);
SurfacePlot;
SelectAll;
Copy;
Dispose;
SelectPic(NewStack);
if i<>1 then AddSlice;
Paste;
SelectPic(OldStack);
DeleteSlice;
end;
Dispose; {OldStack}
RestoreState;
end;
macro 'Make Expression Movie… [E]';
{
Requires the Expression 3.0b filter plug-in, which
is available by anonymous FTP from zippy.nimh.nih.gov,
in the /pub/nih-image/plug-ins directory.
}
var
width,height,nframes,i:integer;
begin
RequiresVersion(1.52);
width:=GetNumber('Width:',200);
height:=GetNumber('Height:',width);
nframes:=GetNumber('Number of Frames:',50);
SetNewSize(width,height);
MakeNewStack('Stack');
MakeNewWindow('Temp');
filter('Reset');
for i:=1 to nframes do begin
SelectWindow('Temp');
filter('Expression 3.0');
SelectAll;
Copy;
SelectWindow('Stack');
if i<>1 then AddSlice;
paste;
end;
SelectWindow('Temp');
Dispose;
end;